﻿''' <summary>
''' 凭证类别类，对应用户表：T_VoucherGroup
''' </summary>
Public Class ClsTVoucherGroup
    Implements IList

    Private m_GroupId As Integer
    Private m_GroupName As String
    Private m_ShortName As String

    Private m_Count As Integer = 3 ' 成员数量

    Public Property GroupId As Integer
        Get
            Return m_GroupId
        End Get
        Set(value As Integer)
            m_GroupId = value
        End Set
    End Property

    Public Property GroupName As String
        Get
            Return m_GroupName
        End Get
        Set(value As String)
            m_GroupName = value
        End Set
    End Property

    Public Property ShortName As String
        Get
            Return m_ShortName
        End Get
        Set(value As String)
            m_ShortName = value
        End Set
    End Property

    Default Public Property Item(index As Integer) As Object Implements IList.Item
        Get

            Select Case index
                Case 0
                    Return m_GroupId

                Case 1
                    Return m_GroupName
                Case 2
                    Return m_ShortName
                Case Else
                    Return Nothing
            End Select
        End Get
        Set(value As Object)

            Select Case value
                Case 0
                    Dim tmpId As Integer
                    If Integer.TryParse(value, tmpId) <> 0 Then
                        m_GroupId = tmpId
                    Else
                        Throw New ArgumentOutOfRangeException("凭证类别编号只能是整数。")
                    End If
                Case 1
                    Dim tmpGN As String = TryCast(value, String)
                    If String.IsNullOrEmpty(tmpGN) Then
                        m_GroupName = tmpGN
                    Else
                        Throw New ArgumentOutOfRangeException("凭证类别名称赋值时超出范围。")
                    End If
                Case 2
                    Dim tmpSN As String = TryCast(value, String)
                    If String.IsNullOrEmpty(tmpSN) Then
                        m_ShortName = tmpSN
                    Else
                        Throw New ArgumentOutOfRangeException("凭证类别字号赋值时超出范围。")
                    End If
                Case Else
                    Throw New ArgumentOutOfRangeException("凭证类别赋值时索引超出范围。")
            End Select
        End Set
    End Property

    Public ReadOnly Property IsReadOnly As Boolean Implements IList.IsReadOnly
        Get
            Throw New NotImplementedException()
        End Get
    End Property

    Public ReadOnly Property IsFixedSize As Boolean Implements IList.IsFixedSize
        Get
            Throw New NotImplementedException()
        End Get
    End Property

    Public ReadOnly Property Count As Integer Implements ICollection.Count
        Get
            'Throw New NotImplementedException()
            Return m_Count
        End Get
    End Property

    Public ReadOnly Property SyncRoot As Object Implements ICollection.SyncRoot
        Get
            Throw New NotImplementedException()
        End Get
    End Property

    Public ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronized
        Get
            Throw New NotImplementedException()
        End Get
    End Property

    Public Sub Clear() Implements IList.Clear
        Throw New NotImplementedException()
    End Sub

    Public Sub Insert(index As Integer, value As Object) Implements IList.Insert
        Throw New NotImplementedException()
    End Sub

    Public Sub Remove(value As Object) Implements IList.Remove
        Throw New NotImplementedException()
    End Sub

    Public Sub RemoveAt(index As Integer) Implements IList.RemoveAt
        Throw New NotImplementedException()
    End Sub

    Public Sub CopyTo(array As Array, index As Integer) Implements ICollection.CopyTo
        Throw New NotImplementedException()
    End Sub

    Public Function Add(value As Object) As Integer Implements IList.Add
        Throw New NotImplementedException()
    End Function

    Public Function Contains(value As Object) As Boolean Implements IList.Contains
        Throw New NotImplementedException()
    End Function

    Public Function IndexOf(value As Object) As Integer Implements IList.IndexOf
        Throw New NotImplementedException()
    End Function

    Public Function GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
        Throw New NotImplementedException()
    End Function
End Class
